<!DOCTYPE html>
<html>
    <head>
        <title>demo</title>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, user-scalable=no, minimum-scale=1.0, maximum-scale=1.0">
        <style>
            body {
                font-family: Monospace;
                background-color: #f0f0f0;
                margin: 0px;
                overflow: hidden;
            }
        </style>
    </head>
    <body>
        <script src="https://cdn.bootcdn.net/ajax/libs/three.js/73/three.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/tween.js/0.11.0/Tween.min.js"></script>
		<script src="https://unpkg.com/three@0.73.1/examples/js/controls/TrackballControls.js"></script>
        <script src="https://cdn.bootcdn.net/ajax/libs/stats.js/10/Stats.min.js"></script>
        <script>

            var jsonstr = '[{"boxId":"9851429300001_5910192S073P0400701_19","x":-75.900002,"y":-87.000000,"z":-572.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":1,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_18","x":4.100000,"y":-87.000000,"z":-572.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":2,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_17","x":-75.900002,"y":-87.000000,"z":-524.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":3,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_16","x":4.100000,"y":-87.000000,"z":-524.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":4,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_15","x":-75.900002,"y":-87.000000,"z":-476.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":5,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_14","x":4.100000,"y":-87.000000,"z":-476.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":6,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_13","x":-75.900002,"y":-87.000000,"z":-428.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":7,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_12","x":4.100000,"y":-87.000000,"z":-428.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":8,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_11","x":-75.900002,"y":-87.000000,"z":-380.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":9,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_10","x":4.100000,"y":-87.000000,"z":-380.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":10,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_9","x":-75.900002,"y":-87.000000,"z":-332.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":11,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_8","x":4.100000,"y":-87.000000,"z":-332.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":12,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_7","x":-75.900002,"y":-1.000000,"z":-572.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":13,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_6","x":4.100000,"y":-1.000000,"z":-572.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":14,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_5","x":-75.900002,"y":-1.000000,"z":-524.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":15,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_4","x":4.100000,"y":-1.000000,"z":-524.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":16,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_3","x":-75.900002,"y":-1.000000,"z":-476.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":17,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_2","x":4.100000,"y":-1.000000,"z":-476.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":18,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_1","x":-75.900002,"y":-1.000000,"z":-428.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":19,"material":"","type":1,"place":200},{"boxId":"9851429300001_5910192S073P0400701_0","x":4.100000,"y":-1.000000,"z":-428.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":93.400002,"platform":"platform32","order":20,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_19","x":-75.900002,"y":-1.000000,"z":-380.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":21,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_18","x":4.100000,"y":-1.000000,"z":-380.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":22,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_17","x":-75.900002,"y":-1.000000,"z":-332.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":23,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_16","x":4.100000,"y":-1.000000,"z":-332.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":24,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_15","x":-75.900002,"y":85.000000,"z":-572.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":25,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_14","x":4.100000,"y":85.000000,"z":-572.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":26,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_13","x":-75.900002,"y":85.000000,"z":-524.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":27,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_12","x":4.100000,"y":85.000000,"z":-524.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":28,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_11","x":-75.900002,"y":85.000000,"z":-476.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":29,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_10","x":4.100000,"y":85.000000,"z":-476.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":30,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_9","x":-75.900002,"y":85.000000,"z":-428.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":31,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_8","x":4.100000,"y":85.000000,"z":-428.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":32,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_7","x":-75.900002,"y":85.000000,"z":-380.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":33,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_6","x":4.100000,"y":85.000000,"z":-380.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":34,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_5","x":-75.900002,"y":85.000000,"z":-332.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":35,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_4","x":4.100000,"y":85.000000,"z":-332.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":36,"material":"","type":1,"place":200},{"boxId":"9844933580001_5910192S077P0400701_3","x":68.099998,"y":-87.000000,"z":-556.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":37,"material":"","type":1,"place":100},{"boxId":"9844933580001_5910192S077P0400701_2","x":68.099998,"y":-1.000000,"z":-556.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":38,"material":"","type":1,"place":100},{"boxId":"9844933580001_5910192S077P0400701_1","x":68.099998,"y":85.000000,"z":-556.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":39,"material":"","type":1,"place":100},{"boxId":"9845287300001_00I69207027410524209-4_0","x":103.349998,"y":-125.250000,"z":-577.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":3.300000,"platform":"platform32","order":40,"material":"","type":1,"place":100},{"boxId":"9837442410001_00J69207027021826716_0","x":103.349998,"y":-115.750000,"z":-577.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":2.400000,"platform":"platform32","order":41,"material":"","type":1,"place":100},{"boxId":"9850084810001_00I69207027420372890_0","x":64.349998,"y":-93.250000,"z":-476.750000,"width":40.500000,"height":73.500000,"length":78.500000,"weight":13.500000,"platform":"platform32","order":42,"material":"","type":1,"place":100},{"boxId":"9833680010001_52401918057P0400700-2_0","x":64.349998,"y":-19.750000,"z":-476.750000,"width":40.500000,"height":73.500000,"length":78.500000,"weight":8.500000,"platform":"platform32","order":43,"material":"","type":1,"place":100},{"boxId":"9837442480001_52401918057P0400700-2_0","x":64.349998,"y":53.750000,"z":-476.750000,"width":40.500000,"height":73.500000,"length":78.500000,"weight":8.500000,"platform":"platform32","order":44,"material":"","type":1,"place":100},{"boxId":"9841197950001_5860101P836P0400700_0","x":63.099998,"y":108.250000,"z":-489.500000,"width":38.000000,"height":35.500000,"length":53.000000,"weight":3.650000,"platform":"platform32","order":45,"material":"","type":1,"place":100},{"boxId":"9849978760001_00I69207027421896218-1_0","x":75.349998,"y":-87.500000,"z":-396.250000,"width":62.500000,"height":85.000000,"length":82.500000,"weight":34.500000,"platform":"platform32","order":46,"material":"","type":1,"place":100},{"boxId":"9841197930001_C26010HM088P0500700-1_0","x":74.099998,"y":-3.950000,"z":-397.500000,"width":60.000000,"height":82.099998,"length":80.000000,"weight":65.500000,"platform":"platform32","order":47,"material":"","type":1,"place":100},{"boxId":"9837440820001_5910100U283P0400700_0","x":74.099998,"y":77.699997,"z":-397.500000,"width":60.000000,"height":81.199997,"length":80.000000,"weight":42.000000,"platform":"platform32","order":48,"material":"","type":1,"place":100},{"boxId":"9849978770001_6080191B043P0400700_0","x":63.349998,"y":123.300003,"z":-419.750000,"width":35.500000,"height":10.000000,"length":38.500000,"weight":2.800000,"platform":"platform32","order":49,"material":"","type":1,"place":200},{"boxId":"9833680010001_682Z8067302-3_0","x":76.599998,"y":-121.250000,"z":-326.500000,"width":57.000000,"height":17.500000,"length":65.000000,"weight":3.000000,"platform":"platform32","order":50,"material":"","type":1,"place":200},{"boxId":"9837442480001_682Z8067302-3_0","x":72.599998,"y":-103.750000,"z":-322.500000,"width":57.000000,"height":17.500000,"length":65.000000,"weight":3.000000,"platform":"platform32","order":51,"material":"","type":1,"place":100},{"boxId":"9849976520001_00J69207027100338213_0","x":62.849998,"y":-83.250000,"z":-336.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":7.660000,"platform":"platform32","order":52,"material":"","type":1,"place":200},{"boxId":"9849978760001_512Z8015728-2_0","x":62.849998,"y":-59.750000,"z":-336.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":5.000000,"platform":"platform32","order":53,"material":"","type":1,"place":200},{"boxId":"9833680010001_7810191L861P0400700-1_0","x":-55.900002,"y":-68.900002,"z":-250.000000,"width":80.000000,"height":122.199997,"length":120.000000,"weight":66.500000,"platform":"platform32","order":54,"material":"","type":1,"place":200},{"boxId":"9837442480001_7810191L861P0400700-1_0","x":-55.900002,"y":-68.900002,"z":-170.000000,"width":80.000000,"height":122.199997,"length":120.000000,"weight":66.500000,"platform":"platform32","order":55,"material":"","type":1,"place":200},{"boxId":"9841193290001_7810191L861P0400700-2_0","x":-55.900002,"y":53.299999,"z":-250.000000,"width":80.000000,"height":122.199997,"length":120.000000,"weight":66.500000,"platform":"platform32","order":56,"material":"","type":1,"place":200},{"boxId":"9841193290001_7810191L861P0400700-1_0","x":-55.900002,"y":53.299999,"z":-170.000000,"width":80.000000,"height":122.199997,"length":120.000000,"weight":66.500000,"platform":"platform32","order":57,"material":"","type":1,"place":200},{"boxId":"9845287300001_C2401043604P0500700-1_0","x":44.099998,"y":-80.250000,"z":-230.000000,"width":80.000000,"height":99.500000,"length":120.000000,"weight":460.000000,"platform":"platform32","order":58,"material":"","type":1,"place":100},{"boxId":"9845287300001_C2401043604P0500700-2_1","x":44.099998,"y":19.250000,"z":-230.000000,"width":80.000000,"height":99.500000,"length":120.000000,"weight":460.000000,"platform":"platform32","order":59,"material":"","type":1,"place":100},{"boxId":"9849972350001_24701915045P0400700-1_0","x":44.099998,"y":93.400002,"z":-230.000000,"width":80.000000,"height":48.799999,"length":120.000000,"weight":74.500000,"platform":"platform32","order":60,"material":"","type":1,"place":100},{"boxId":"9844933580001_5910192S077P0400701_0","x":44.099998,"y":-87.000000,"z":-146.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":92.800003,"platform":"platform32","order":61,"material":"","type":1,"place":200},{"boxId":"9841193290001_00J69207027120005304-3_0","x":-55.900002,"y":-73.849998,"z":-82.000000,"width":80.000000,"height":112.300003,"length":120.000000,"weight":60.000000,"platform":"platform32","order":62,"material":"","type":1,"place":200},{"boxId":"9845287300001_C2401043604P0500700-2_0","x":-55.900002,"y":32.049999,"z":-82.000000,"width":80.000000,"height":99.500000,"length":120.000000,"weight":460.000000,"platform":"platform32","order":63,"material":"","type":1,"place":200},{"boxId":"9845243480001_1800190H369P0400700-1_0","x":-77.400002,"y":105.500000,"z":-83.500000,"width":77.000000,"height":47.400002,"length":77.000000,"weight":42.500000,"platform":"platform32","order":64,"material":"","type":1,"place":100},{"boxId":"9850084810001_00I69207027420372906_0","x":50.099998,"y":-74.199997,"z":-76.000000,"width":92.000000,"height":111.599998,"length":92.000000,"weight":65.000000,"platform":"platform32","order":65,"material":"","type":1,"place":100},{"boxId":"9845287300001_00J69207027040550018-3_0","x":42.599998,"y":40.599998,"z":-83.500000,"width":77.000000,"height":118.000000,"length":77.000000,"weight":359.500000,"platform":"platform32","order":66,"material":"","type":1,"place":100},{"boxId":"9837448520001_00J69207027130606908-1_0","x":-55.900002,"y":-86.750000,"z":10.000000,"width":80.000000,"height":86.500000,"length":120.000000,"weight":67.000000,"platform":"platform32","order":67,"material":"","type":1,"place":200},{"boxId":"9849979390001_C26019F3036P0500701-1_0","x":-77.400002,"y":-2.150000,"z":8.500000,"width":77.000000,"height":82.699997,"length":77.000000,"weight":97.500000,"platform":"platform32","order":68,"material":"","type":1,"place":100},{"boxId":"9843793290001_60801017510P0400700_0","x":-77.400002,"y":62.849998,"z":8.500000,"width":77.000000,"height":47.299999,"length":77.000000,"weight":39.500000,"platform":"platform32","order":69,"material":"","type":1,"place":100},{"boxId":"9849751600001_7810102U591P0400700_0","x":-60.900002,"y":-96.750000,"z":105.000000,"width":110.000000,"height":66.500000,"length":110.000000,"weight":83.000000,"platform":"platform08","order":70,"material":"","type":1,"place":100},{"boxId":"9818585540001_00I69207027320603508-2_0","x":93.849998,"y":123.050003,"z":-418.500000,"width":22.500000,"height":9.500000,"length":38.000000,"weight":1.100000,"platform":"platform09","order":71,"material":"","type":1,"place":100},{"boxId":"9856269880001_2490191Z070P0500601-1_0","x":55.349998,"y":123.050003,"z":-380.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.760000,"platform":"platform09","order":72,"material":"","type":1,"place":100},{"boxId":"9855723370001_8180100H243P0400500-2_0","x":77.849998,"y":123.050003,"z":-380.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.750000,"platform":"platform09","order":73,"material":"","type":1,"place":100},{"boxId":"9850282810001_00J69207027161342952-1_0","x":-20.150000,"y":119.150002,"z":-278.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.460000,"platform":"platform09","order":74,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-3_0","x":-20.150000,"y":119.150002,"z":-256.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":75,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-2_0","x":-20.150000,"y":119.150002,"z":-233.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":76,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-3_6","x":-20.150000,"y":119.150002,"z":-211.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":77,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-3_5","x":-20.150000,"y":119.150002,"z":-188.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":78,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-3_4","x":-20.150000,"y":119.150002,"z":-166.250000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":79,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-3_3","x":-20.150000,"y":119.150002,"z":-143.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":80,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-3_2","x":22.850000,"y":122.550003,"z":-278.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":81,"material":"","type":1,"place":200},{"boxId":"9850282810001_5980100J871P0400500-3_1","x":60.349998,"y":122.550003,"z":-278.750000,"width":22.500000,"height":9.500000,"length":37.500000,"weight":0.300000,"platform":"platform09","order":82,"material":"","type":1,"place":200},{"boxId":"9842583530001_4580100R615P0400700_0","x":-19.750000,"y":103.800003,"z":-91.750000,"width":38.299999,"height":44.000000,"length":60.500000,"weight":10.500000,"platform":"platform09","order":83,"material":"","type":1,"place":100},{"boxId":"9851668710001_682Z8067302-3_0","x":36.599998,"y":108.349998,"z":-93.500000,"width":57.000000,"height":17.500000,"length":65.000000,"weight":3.000000,"platform":"platform09","order":84,"material":"","type":1,"place":200},{"boxId":"9847632210001_6080103P370P0400500_0","x":-86.400002,"y":102.000000,"z":-10.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":15.600000,"platform":"platform09","order":85,"material":"","type":1,"place":200},{"boxId":"9847632180001_6080194E044P0400700_0","x":-86.400002,"y":102.000000,"z":28.500000,"width":39.000000,"height":31.000000,"length":59.000000,"weight":14.840000,"platform":"platform09","order":86,"material":"","type":1,"place":200},{"boxId":"9845246250001_52401918057P0400700-1_0","x":-18.650000,"y":-6.750000,"z":9.250000,"width":40.500000,"height":73.500000,"length":78.500000,"weight":8.500000,"platform":"platform09","order":87,"material":"","type":1,"place":100},{"boxId":"9853334760001_00J69207027280633296_0","x":-18.799999,"y":57.500000,"z":9.100000,"width":40.200001,"height":55.000000,"length":78.199997,"weight":24.500000,"platform":"platform09","order":88,"material":"","type":1,"place":100},{"boxId":"9841197770001_78101030509P0400700_0","x":-20.150000,"y":96.750000,"z":-11.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":1.750000,"platform":"platform09","order":89,"material":"","type":1,"place":200},{"boxId":"9849977190001_78101030509P0400700_0","x":-20.150000,"y":96.750000,"z":24.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":1.750000,"platform":"platform09","order":90,"material":"","type":1,"place":200},{"boxId":"9847632180001_6080194E043P0400700_0","x":44.099998,"y":-83.349998,"z":0.000000,"width":60.000000,"height":93.300003,"length":80.000000,"weight":125.000000,"platform":"platform09","order":91,"material":"","type":1,"place":200},{"boxId":"9850598610001_2880101R266P0400700-1_0","x":44.849998,"y":-11.950000,"z":-9.250000,"width":41.500000,"height":49.500000,"length":81.500000,"weight":44.500000,"platform":"platform09","order":92,"material":"","type":1,"place":200},{"boxId":"9855679060001_00J69207027011490381-1_0","x":22.850000,"y":24.549999,"z":-11.750000,"width":36.500000,"height":23.500000,"length":37.500000,"weight":1.570000,"platform":"platform09","order":93,"material":"","type":1,"place":200},{"boxId":"9851668710001_7810191L861P0400700-1_0","x":-55.900002,"y":-2.400000,"z":90.000000,"width":80.000000,"height":122.199997,"length":120.000000,"weight":66.500000,"platform":"platform09","order":94,"material":"","type":1,"place":200},{"boxId":"9835022960001_24701915045P0400700-1_0","x":-55.900002,"y":83.099998,"z":90.000000,"width":80.000000,"height":48.799999,"length":120.000000,"weight":74.500000,"platform":"platform09","order":95,"material":"","type":1,"place":200},{"boxId":"9847331530001_00J69207027151069430_0","x":44.099998,"y":-69.949997,"z":110.000000,"width":80.000000,"height":120.099998,"length":120.000000,"weight":264.500000,"platform":"platform09","order":96,"material":"","type":1,"place":100},{"boxId":"9851668710001_00J69207027120005304-2_0","x":44.099998,"y":46.250000,"z":110.000000,"width":80.000000,"height":112.300003,"length":120.000000,"weight":60.000000,"platform":"platform09","order":97,"material":"","type":1,"place":100},{"boxId":"9818585470001_00I69207027410860819_0","x":-55.900002,"y":-74.550003,"z":210.000000,"width":80.000000,"height":110.900002,"length":120.000000,"weight":137.500000,"platform":"platform09","order":98,"material":"","type":1,"place":200},{"boxId":"9837326820001_00I69207027410860819_0","x":-55.900002,"y":36.349998,"z":210.000000,"width":80.000000,"height":110.900002,"length":120.000000,"weight":137.500000,"platform":"platform09","order":99,"material":"","type":1,"place":200},{"boxId":"9851510010001_4840100L562P0400700_0","x":42.599998,"y":-100.300003,"z":208.500000,"width":77.000000,"height":59.400002,"length":77.000000,"weight":96.500000,"platform":"platform09","order":100,"material":"","type":1,"place":100},{"boxId":"9855723370001_00J69207027050249175-1_0","x":42.599998,"y":-43.599998,"z":208.500000,"width":77.000000,"height":54.000000,"length":77.000000,"weight":39.000000,"platform":"platform09","order":101,"material":"","type":1,"place":100},{"boxId":"9842583530001_4580100R617P0400700_1","x":-55.900002,"y":-79.849998,"z":290.000000,"width":80.000000,"height":100.300003,"length":120.000000,"weight":131.500000,"platform":"platform09","order":102,"material":"","type":1,"place":200},{"boxId":"9842583530001_4580100R617P0400700_0","x":-55.900002,"y":20.450001,"z":290.000000,"width":80.000000,"height":100.300003,"length":120.000000,"weight":131.500000,"platform":"platform09","order":103,"material":"","type":1,"place":200},{"boxId":"9847633690001_3460192L184P0400700_0","x":-55.900002,"y":-92.250000,"z":370.000000,"width":80.000000,"height":75.500000,"length":120.000000,"weight":169.000000,"platform":"platform09","order":104,"material":"","type":1,"place":200},{"boxId":"9847619860001_3460192L184P0400700_0","x":-55.900002,"y":-16.750000,"z":370.000000,"width":80.000000,"height":75.500000,"length":120.000000,"weight":169.000000,"platform":"platform09","order":105,"material":"","type":1,"place":200},{"boxId":"9818585540001_4580192A231P0400700-1_0","x":-55.900002,"y":66.199997,"z":370.000000,"width":80.000000,"height":90.400002,"length":120.000000,"weight":108.000000,"platform":"platform09","order":106,"material":"","type":1,"place":200},{"boxId":"9851506370001_00I69207027521212468-1_0","x":-55.900002,"y":-88.699997,"z":450.000000,"width":80.000000,"height":82.599998,"length":120.000000,"weight":56.000000,"platform":"platform09","order":107,"material":"","type":1,"place":200},{"boxId":"9845288210001_6490190Q026P0400700_2","x":42.849998,"y":16.400000,"z":208.750000,"width":77.500000,"height":66.000000,"length":77.500000,"weight":25.000000,"platform":"platform34","order":108,"material":"","type":1,"place":100},{"boxId":"9845288210001_6490190Q026P0400700_1","x":42.849998,"y":82.400002,"z":208.750000,"width":77.500000,"height":66.000000,"length":77.500000,"weight":25.000000,"platform":"platform34","order":109,"material":"","type":1,"place":100},{"boxId":"9845288210001_6490190Q026P0400700_0","x":42.849998,"y":-97.000000,"z":288.750000,"width":77.500000,"height":66.000000,"length":77.500000,"weight":25.000000,"platform":"platform34","order":110,"material":"","type":1,"place":100},{"boxId":"9837110260001_71001017588P0400500_2","x":44.099998,"y":-18.500000,"z":280.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":105.500000,"platform":"platform10","order":111,"material":"","type":1,"place":200},{"boxId":"9837110260001_71001017588P0400500_1","x":44.099998,"y":72.500000,"z":280.000000,"width":60.000000,"height":91.000000,"length":80.000000,"weight":105.500000,"platform":"platform10","order":112,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_19","x":28.100000,"y":-87.000000,"z":370.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":113,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_18","x":76.099998,"y":-87.000000,"z":370.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":114,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_17","x":28.100000,"y":-1.000000,"z":370.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":115,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_16","x":76.099998,"y":-1.000000,"z":370.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":116,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_15","x":28.100000,"y":85.000000,"z":370.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":117,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_14","x":76.099998,"y":85.000000,"z":370.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":118,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_13","x":-91.900002,"y":-4.400000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":119,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_12","x":-43.900002,"y":-4.400000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":120,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_11","x":-91.900002,"y":81.599998,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":121,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_10","x":-43.900002,"y":81.599998,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":122,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_9","x":28.100000,"y":-87.000000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":123,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_8","x":76.099998,"y":-87.000000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":124,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_7","x":28.100000,"y":-1.000000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":125,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_6","x":76.099998,"y":-1.000000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":126,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_5","x":28.100000,"y":85.000000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":127,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_4","x":76.099998,"y":85.000000,"z":450.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":128,"material":"","type":1,"place":100},{"boxId":"9850130550001_6080102F198P0400700_3","x":-75.900002,"y":-87.000000,"z":514.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":129,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_2","x":4.100000,"y":-87.000000,"z":514.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":130,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_1","x":-75.900002,"y":-87.000000,"z":562.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":131,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_0","x":4.100000,"y":-87.000000,"z":562.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":132,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_23","x":-75.900002,"y":-1.000000,"z":514.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":133,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_22","x":4.100000,"y":-1.000000,"z":514.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":134,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_21","x":-75.900002,"y":-1.000000,"z":562.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":135,"material":"","type":1,"place":200},{"boxId":"9850130550001_6080102F198P0400700_20","x":4.100000,"y":-1.000000,"z":562.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":136,"material":"","type":1,"place":200},{"boxId":"9850131670001_6080102F198P0400700_18","x":-75.900002,"y":85.000000,"z":514.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":137,"material":"","type":1,"place":200},{"boxId":"9850131670001_6080102F198P0400700_17","x":4.100000,"y":85.000000,"z":514.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":138,"material":"","type":1,"place":200},{"boxId":"9850131670001_6080102F198P0400700_16","x":-75.900002,"y":85.000000,"z":562.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":139,"material":"","type":1,"place":200},{"boxId":"9850131670001_6080102F198P0400700_15","x":4.100000,"y":85.000000,"z":562.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":140,"material":"","type":1,"place":200},{"boxId":"9850131670001_6080102F198P0400700_14","x":68.099998,"y":-87.000000,"z":530.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":141,"material":"","type":1,"place":100},{"boxId":"9850131670001_6080102F198P0400700_13","x":68.099998,"y":-1.000000,"z":530.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":142,"material":"","type":1,"place":100},{"boxId":"9850131670001_6080102F198P0400700_12","x":68.099998,"y":85.000000,"z":530.000000,"width":48.000000,"height":86.000000,"length":80.000000,"weight":88.000000,"platform":"platform10","order":143,"material":"","type":1,"place":100}]';
			var jsonstr2 = '{"container_length":1192.000000,"container_width":231.800003,"container_height":260.000000,"container_max_load":null,"container_type_name":"40HQ"}'
            var objectArray= JSON.parse(jsonstr);
			var truckJsonObj = JSON.parse(jsonstr2);
            var container, stats;
            var camera, controls, scene, projector, renderer;
            var objects = [], plane;
            var mouse = new THREE.Vector2(), offset = new THREE.Vector3(), INTERSECTED, SELECTED; 
            init();
            animate();
            function init() {
                container = document.createElement( 'div' );
                document.body.appendChild( container );
                camera = new THREE.PerspectiveCamera( 70, window.innerWidth / window.innerHeight, 1, 10000 );
                camera.position.x = -600;
                camera.position.y = 400;
                camera.position.z = 1000;
                controls = new THREE.TrackballControls( camera );
                controls.rotateSpeed = 1.0;
                controls.zoomSpeed = 1.2;
                controls.panSpeed = 0.8;
                controls.noZoom = false;
                controls.noPan = true;
                controls.staticMoving = false;
                controls.dynamicDampingFactor = 0.3;
                scene = new THREE.Scene();
                var ambientLight = new THREE.AmbientLight( Math.random() *0xffffff );
                scene.add( ambientLight );
                var directionalLight = new THREE.DirectionalLight( Math.random() * 0xffffff );
                directionalLight.position.set( 0, 1, 0 );
                scene.add( directionalLight );
                var pointLight = new THREE.PointLight( 0xff0000, 1, 500 );
                pointLight.position.set( 0, 0, -200 );
                scene.add( pointLight );

                container_length = truckJsonObj.container_length;
                container_width = truckJsonObj.container_width;
                container_height = truckJsonObj.container_height;
                var cube_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( container_width, container_height, container_length, 1,1,1 ), 
                    new THREE.MeshBasicMaterial( { color:0xefb73e, wireframe:true } )
                );
                cube_1.position.x = 0;
                cube_1.position.y = 0;
                cube_1.position.z = 0;
                scene.add( cube_1 );

                truck_head_length = 145;
                var truck_head_1 = new THREE.Mesh(
                    new THREE.BoxGeometry( 200, 100, truck_head_length, 1, 1, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_1.position.x = 0;
                truck_head_1.position.y = -50;
                truck_head_1.position.z = -(container_length/2 + truck_head_length/2);
                scene.add( truck_head_1 );
                
                truck_head_length_2 = 80;
                var truck_head_2 = new THREE.Mesh(
                    new THREE.BoxGeometry( 170, 60, truck_head_length_2, 1, 0, 5 ), 
                    new THREE.MeshBasicMaterial( { color: 0xffffff, wireframe:true } )
                );
                truck_head_2.position.x = 0;
                truck_head_2.position.y = 30;
                truck_head_2.position.z = -(container_length/2 + truck_head_length_2/2);
                scene.add( truck_head_2 );
                
                truck_head_chimney_radius = 7;
                var truck_head_chimney1 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney1.position.x = 100;
                truck_head_chimney1.position.y = 50;
                truck_head_chimney1.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney1 );
                
                var truck_head_chimney2 = new THREE.Mesh(
                    new THREE.CylinderGeometry( truck_head_chimney_radius, truck_head_chimney_radius, 300, 20 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_head_chimney2.position.x = -100;
                truck_head_chimney2.position.y = 50;
                truck_head_chimney2.position.z = -(container_length/2 + truck_head_chimney_radius/2);
                scene.add( truck_head_chimney2 );
        
                var truck_wheel_1 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_1.position.x = 110;
                truck_wheel_1.position.y = -100;
                truck_wheel_1.position.z = -(container_length/2 + truck_head_length_2/2 + 20) ;
                truck_wheel_1.rotation.x = 0;
                truck_wheel_1.rotation.y = 0;
                truck_wheel_1.rotation.z = 1.6;
                scene.add( truck_wheel_1 );
                
                var truck_wheel_2 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_2.position.x = -110;
                truck_wheel_2.position.y = -100;
                truck_wheel_2.position.z = -(container_length/2 + truck_head_length_2/2 + 20);
                truck_wheel_2.rotation.x = 0;
                truck_wheel_2.rotation.y = 0;
                truck_wheel_2.rotation.z = 1.6;
                scene.add( truck_wheel_2 );

                offset_2 = -240;
                var truck_wheel_5 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_5.position.x = container_width/2 + 5;
                truck_wheel_5.position.y = -100;
                truck_wheel_5.position.z = (container_length/2 + truck_head_length_2/2 + offset_2) ;
                truck_wheel_5.rotation.x = 0;
                truck_wheel_5.rotation.y = 0;
                truck_wheel_5.rotation.z = 1.6;
                scene.add( truck_wheel_5 );

                var truck_wheel_6 = new THREE.Mesh(new THREE.CylinderGeometry( 50, 50, 20, 50 ), 
                    new THREE.MeshBasicMaterial( { color:0xffffff, wireframe:true } )
                );
                truck_wheel_6.position.x = -container_width/2 - 5;
                truck_wheel_6.position.y = -100;
                truck_wheel_6.position.z = (container_length/2 + truck_head_length_2/2 + offset_2);
                truck_wheel_6.rotation.x = 0;
                truck_wheel_6.rotation.y = 0;
                truck_wheel_6.rotation.z = 1.6;
                scene.add( truck_wheel_6 );

                for (var i in objectArray) {
                    if (objectArray[i].type==2) {
						var cylinderTopR = objectArray[i].length / 2;
						var cylinderHeight = objectArray[i].height;
						if (objectArray[i].place == 1 || objectArray[i].place == 2)
						{
							cylinderHeight = objectArray[i].width;
						}
						
                        var object2 = new THREE.Mesh(
						    new THREE.CylinderGeometry(cylinderTopR, cylinderTopR, cylinderHeight, 60),
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object2.position.x = objectArray[i].x;
                        object2.position.y = objectArray[i].y;
                        object2.position.z = objectArray[i].z;
                        if (objectArray[i].place==1) {
                            object2.rotation.z = 55;
                        }
                        if (objectArray[i].place==2) {
                            object2.rotation.x = 55;
                        }
                        object2.width = objectArray[i].width;
                        object2.height = objectArray[i].height;
                        object2.length = objectArray[i].length;
                        object2.weight = objectArray[i].weight;
                        object2.platform = objectArray[i].platform;
                        object2.order = objectArray[i].order;
                        object2.materialInfo = objectArray[i].material;
                        object2.boxId = objectArray[i].boxId;
                        object2.type = objectArray[i].type;
                        object2.place = objectArray[i].place;
                        scene.add( object2 );
                        objects.push( object2 );
                    }
                    if (objectArray[i].type==1) {
						if (objectArray[i].place == 200)
						{
							var box_length = objectArray[i].width;
                            var box_width = objectArray[i].length;
						}
						else
						{
							var box_length = objectArray[i].length;
							var box_width = objectArray[i].width;
						}
						var box_height = objectArray[i].height;
                        var object = new THREE.Mesh(
                            new THREE.BoxGeometry( box_width, box_height, box_length, 1, 1, 1 ), 
                            new THREE.MeshBasicMaterial( { color: Math.random() * 0xffffff , wireframe:false } ) 
                        ); 
                        object.position.x = objectArray[i].x;
                        object.position.y = objectArray[i].y;
                        object.position.z = objectArray[i].z;
						object.length = objectArray[i].length;
						object.width = objectArray[i].width;
						object.height = objectArray[i].height;
                        object.weight = objectArray[i].weight;
                        object.platform = objectArray[i].platform;
                        object.order = objectArray[i].order;
                        object.materialInfo = objectArray[i].material;
                        object.boxId = objectArray[i].boxId;
                        object.type = objectArray[i].type;
                        object.place = objectArray[i].place;
                        scene.add( object );
                        objects.push( object );
                    }
                }

                plane = new THREE.Mesh(
                    new THREE.PlaneGeometry( 2000, 2000, 8, 8 ),
                    new THREE.MeshBasicMaterial( { color: 0x000000, opacity: 0.25, transparent: true, wireframe: true } )
                );
                plane.visible = true;
                scene.add( plane );
                projector = new THREE.Projector();
                renderer = new THREE.WebGLRenderer( { antialias: true } );
                renderer.sortObjects = false;
                renderer.setSize( window.innerWidth, window.innerHeight );
                renderer.shadowMapEnabled = true;
                renderer.shadowMapType = THREE.PCFShadowMap;
                container.appendChild( renderer.domElement );

                stats = new Stats();
                stats.domElement.style.position = 'absolute';
                stats.domElement.style.top = '0px';
                container.appendChild( stats.domElement );

                window.addEventListener( 'resize', onWindowResize, false );
                renderer.domElement.addEventListener( 'mousemove', onDocumentMouseMove, false );
                renderer.domElement.addEventListener( 'mousedown', onDocumentMouseDown, false );
                renderer.domElement.addEventListener( 'mouseup', onDocumentMouseUp, false );
            }

            function onDocumentMouseMove( event ) {
                event.preventDefault();
                mouse.x = ( event.clientX / window.innerWidth ) * 2 - 1;
                mouse.y = - ( event.clientY / window.innerHeight ) * 2 + 1;
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    if ( INTERSECTED != intersects[ 0 ].object ) {
                        INTERSECTED = intersects[ 0 ].object;
                        plane.position.copy( INTERSECTED.position );
                        plane.lookAt( camera.position );
                    }
                    container.style.cursor = 'pointer';
                } else {
                    container.style.cursor = 'auto';
                }
            }

            function onDocumentMouseDown( event ) {
                event.preventDefault();
                var vector = new THREE.Vector3( mouse.x, mouse.y, 0.5 );
                projector.unprojectVector( vector, camera );
                var raycaster = new THREE.Raycaster( camera.position, vector.sub( camera.position ).normalize() );
                var intersects = raycaster.intersectObjects( objects );
                if ( intersects.length > 0 ) {
                    controls.enabled = false;  
                    SELECTED = intersects[ 0 ].object;
                    var info = '<B>' + 
                        'boxId: ' + SELECTED.boxId +
                        '</br> x: ' + SELECTED.position.x + 
                        '</br> y: ' + SELECTED.position.y + 
                        '</br> z: ' + SELECTED.position.z + 
                        '</br> width: ' + SELECTED.width + 
                        '</br> height: ' + SELECTED.height + 
                        '</br> length: ' + SELECTED.length + 
                        '</br> weight: ' + SELECTED.weight +
                        '</br> platform: ' + SELECTED.platform +
                        '</br> order: ' + SELECTED.order +
                        '</br> material: ' + SELECTED.materialInfo + 
                        '</br> type: ' + SELECTED.type + 
                        '</br> place: ' + SELECTED.place + 
                        '</B>' +
                        '</br>' + 
                        '--------------------------' + 
                        '</br>' +
                        'type(1:箱体 2:圆柱体)' +
                        '</br>' +
                        'place(1:品字型 2:田字型)';
                    $("#objectInfo").html(info);
                }
            }

            function onDocumentMouseUp( event ) {
                event.preventDefault();
                controls.enabled = true;
                if ( INTERSECTED ) {
                    plane.position.copy( INTERSECTED.position );
                    SELECTED = null;
                }
                container.style.cursor = 'auto';
            }

            function onWindowResize() {
                camera.aspect = window.innerWidth / window.innerHeight;
                camera.updateProjectionMatrix();
                renderer.setSize( window.innerWidth, window.innerHeight );
            }

            function animate() {
                requestAnimationFrame( animate );
                render();
                stats.update();
            }

            function render() {
                controls.update();
                renderer.render( scene, camera );
            }

        </script>
        <div id="objectInfo" class="a2"><br/>点击物体获取相关属性</div>
        <style>
            .a2{position:absolute; left:20px; top:50px; bottom:0px; width:180px; height:250px; z-index:9999; background: #00FFFF; font-weight:bold; }
        </style>
    </body>
</html>